package com.test;

import com.login.ConfigActivity;
import com.utils.FileUtils;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class StageTabListAvtivity extends TabActivity {
	public static final String EXTRA_PROMO = "promo";

	public void onCreate(Bundle savedInstanceState) {

	    super.onCreate(savedInstanceState);	    
	    setContentView(R.layout.report_tab);
		
	    FileUtils util=new FileUtils();
	    if(util.isFileExist("config/ece_configuration.conf")){	    	
	   
	    
		Resources res = getResources(); // Resource object to get Drawables
		TabHost tabHost = getTabHost(); // The activity TabHost
		TabHost.TabSpec stage; // Resusable TabSpec for each tab
		Intent intent; // Reusable Intent for each tab

		// Create an Intent to launch an Activity for the tab (to be reused)
		intent = new Intent().setClass(this, StageListActivity.class).putExtra(
				EXTRA_PROMO, "5");

		// Initialize a TabSpec for each tab and add it to the TabHost
		stage = tabHost.newTabSpec("ing5").setIndicator("ING5")
				.setContent(intent);
		tabHost.addTab(stage);

		// Do the same for the other tabs
		intent = new Intent().setClass(this, StageListActivity.class).putExtra(
				EXTRA_PROMO, "4");
		stage = tabHost.newTabSpec("ing4").setIndicator("ING4")
				.setContent(intent);
		tabHost.addTab(stage);

		intent = new Intent().setClass(this, StageListActivity.class).putExtra(
				EXTRA_PROMO, "3");
		stage = tabHost.newTabSpec("ing3").setIndicator("ING3")
				.setContent(intent);
		tabHost.addTab(stage);

		tabHost.setCurrentTab(1);
	    }else{
	    	Intent intent=new Intent(getApplicationContext(), ConfigActivity.class);
	    	startActivity(intent);
	    }
	}
}
